package crawler.http;

import java.util.Random;

/**
 * USER: lintc 【lintiancong@zhuojianchina.com】
 * DATE: 2017-09-13 09:40
 */
public class HttpUserAgent {

    public final static String BROWSER_CHROME = "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36";

    public final static String PHONE_ANDROID = "Mozilla/5.0 (Linux; U; Android 4.0.3; de-de; Galaxy S II Build/GRJ22) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";

    public final static String PHONE_IOS = "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; FujitsuToshibaMobileCommun; IS12T; KDDI)";

    public final static String PHONE_BLACK_BERRY = "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en-US) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.201 Mobile Safari/534.1+";

    public final static String BROWSER_OPERA = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60";

    public final static String BROWSER_FIREFOX = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0";

    public final static String BROWSER_SAFARI = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2 ";

    public final static String BROWSER_360 = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36";

    public final static String BROWSER_TAOBAO = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11";

    public static String[] agentList = new String[]{BROWSER_CHROME, BROWSER_OPERA, BROWSER_FIREFOX, BROWSER_SAFARI, BROWSER_360, BROWSER_TAOBAO};

    public static Random random = new Random();

    public static String getAgent() {
        int index = random.nextInt(agentList.length);
        return agentList[index];
    }

    public static void main(String[] args) {
        System.out.println(getAgent());
    }
}
